package entity;
import java.io.File;
import java.util.Properties;

import utils.Base;

public class MasterConfig {
    private String dstPath;
    private String archivePath;
    private String steamshPath;
    private String gameServerBindPath;
    private String kleiBindPath;
    private String dst_docker_image;
    private String center_server_host;
    private final String UPLOAD_DIRECTORY = "uploads";
    
    public int load(File configFile)
    {
        if (!configFile.exists())
        {
            return -1;
        }

        Properties properties = Base.loadConfig(configFile.getAbsolutePath());
        dstPath = properties.getProperty("dstPath");
        archivePath = properties.getProperty("archivePath");
        steamshPath = properties.getProperty("steamshPath");
        gameServerBindPath = properties.getProperty("gameServerBindPath");
        kleiBindPath = properties.getProperty("kleiBindPath");
        dst_docker_image = properties.getProperty("dst_docker_image");
        center_server_host = properties.getProperty("center_server_host");

        return 0;
    }

    public String getUploadDir() {
        return UPLOAD_DIRECTORY;
    }

    public String getDstPath() {
        return dstPath;
    }

    public String getArchivePath() {
        return archivePath;
    }

    public String getSteamshPath() {
        return steamshPath;
    }

    public String getGameServerBindPath() {
        return gameServerBindPath;
    }

    public String getKleiBindPath() {
        return kleiBindPath;
    }

    public String getDst_docker_image() {
        return dst_docker_image;
    }

    public String getCenter_server_host() {
        return center_server_host;
    }

    @Override
    public String toString() {
        return "MasterConfig [dstPath=" + dstPath + ", archivePath=" + archivePath + ", steamshPath=" + steamshPath
                + ", gameServerBindPath=" + gameServerBindPath + ", kleiBindPath=" + kleiBindPath
                + ", dst_docker_image=" + dst_docker_image + ", center_server_host=" + center_server_host
                + ", UPLOAD_DIRECTORY=" + UPLOAD_DIRECTORY + "]";
    }

    
}
